import Vue from 'vue'
import Router from 'vue-router'
import main from '@/components/main'
import login from '@/views/auth/login'
import register from '@/views/auth/register'
import resetPassword from '@/views/auth/resetPassword'
import order_today from '@/views/order_today/list'
import department from '@/views/department/list'
import users from '@/views/users/list'
import time from '@/views/time/list'

Vue.use(Router);

export default new Router({
  routes: [
      {
          path: '/',
          name: 'main',
          component: main,
          redirect : "/order_today",
          children: [
              {
                  path: '/order_today',
                  name: 'order_today',
                  component: order_today
              },
              {
                  path: '/department',
                  name: 'department',
                  component: department
              },
              {
                  path: '/users',
                  name: 'users',
                  component: users
              },
              {
                  path: '/time',
                  name: 'time',
                  component: time
              }
          ]
      },
      {
          path: '/login',
          name: 'login',
          meta : {
              requireAuth: true,
          },
          component: login
      },
      {
          path: '/register',
          name: 'register',
          meta : {
              requireAuth: true,
          },
          component: register
      },
      {
          path: '/resetPassword',
          name: 'resetPassword',
          meta : {
              requireAuth: true,
          },
          component: resetPassword
      }
  ]
})
